package com.blue.common.i18n;

import java.util.Locale;

import org.springframework.web.servlet.LocaleResolver;

import com.blue.common.spring.SpringContextHolder;


public class I18nMessage {
    /**
     * 获取国际化信息
     * @param key 键
     * @param args 信息中的参数
     * @return
     */
	public static String getMessage(String key, Object... args) {
    	LocaleResolver localeResolver = (LocaleResolver) SpringContextHolder.getBean(LocaleResolver.class);
        Locale localLocale = localeResolver.resolveLocale(SpringContextHolder.getRequest());
        return SpringContextHolder.getApplicationContext().getMessage(key, args, localLocale);
    }
}
